package com.example.rbacmanage.common;

import lombok.Data;
import org.springframework.http.ResponseEntity;

import java.io.Serializable;


@Data
public class Result<T> implements Serializable {
    private int code;
    private String msg;
    private T data;

    public Result(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static Result success(Object o) {
        return new Result<>(200,"成功",o);
    }

    public static Result success() {
        return new Result<>(200,"成功",null);
    }

    public static Result error(String msg) {
        return new Result<>(500,msg,null);
    }
}
